﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UserActivity/UserActivityTemlates.Master" AutoEventWireup="true" CodeBehind="OPAdd.aspx.cs" Inherits="WebApplication.UserActivity.OPAdd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

<script type="text/javascript">
    //Delete form()
    function DeleteThis(th) {

        self = $(th);
        $("#" + id).find(".addimg").show();
        self.parents(".activediv").remove();

    }

    //add function
    function AddFormModel(type) {
        //item
        var str1 = "<div class=\"activediv\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">";
        str1 += "<tbody><tr><td width=\"20\" valign=\"bottom\"><p>&nbsp;</p>";
            str1 += "<img src=\"../Media/Css/images/add-green.png\" class=\"upimg addimg\" onclick='AddFormModel(\"OP\")' />";
            str1 += "<img src=\"../Media/Css/images/delete-green.png\" onclick='DeleteThis(this)' /></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Rec'd Date</p>";
            str1 += "<input type=\"text\" class=\"input70\" value=\"01 Mar 2011\"></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Price Code</p><select class=\"select80\"><option>GPOMIF</option></select></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Online Package</p><span>A. Near Harbour Ktchen</span></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Qty</p><select class=\"sl1\"><option>9</option></select></td> ";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Unit</p><select class=\"select50\"><option></option></select></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Unit Cost</p><span>HKD 400.00</span></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Sub-Total</p><span>HKD 1,200.00</span></td>";
            str1 += "<td><p class=\"mdd-s\">Surcharge</p><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"all-pr-table\">";
            str1 += "<tr><td><p class=\"upinput\">Currency</p><select class=\"sl2\"><option>HKD</option></select>";
            str1 += "</td><td><p class=\"upinput\">$</p><input type=\"text\" class=\"input20\"></td>";
            str1 += "<td><p class=\"upinput\">%</p><input type=\"text\" class=\"input20\"></td></tr></table></td>";
            str1 += "<td><p class=\"mdd-d\">Discount</p><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"all-pr-table\">";
            str1 += "<tr><td><p class=\"upinput\">Currency</p><select class=\"sl2\"><option>HKD</option></select>";
            str1 += "</td><td><p class=\"upinput\">$</p><input type=\"text\" class=\"input20\"></td>";
            str1 += "<td><p class=\"upinput\">%</p><input type=\"text\" class=\"input20\"></td></tr></table></td>";
            str1 += "<td><p>&nbsp;</p><p class=\"upinput\">Sub Total</p><span>HKD 1,200.00</span>";
            str1 += "</td></tr></tbody></table></div>";

        str = "";
        id = "";
        switch (type) {
            case "OP":
                str = str1;
                id = "OnlineP";
                break;

        }

        var msg = "最多可以放5個!";
        var len = $("#" + id).find(".activediv").size();
        if (len < 5) {
            $("#" + id).append(str);
            if (len < 4)
                $("#" + id).find(".addimg").show();
            else
                $("#" + id).find(".addimg").hide();
        }
        else {
            $("#" + id).prev(".addimg").hide();
            alert(msg)
        }
    }
</script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <div class="content-title">
    <h1>Activity > Export Marketing > Activity Record</h1>
  </div> 
  <div class="con-nav">
    <a href="#" class="btn"><span class="ui-icon ui-icon-newwin"></span>Add New Record</a>
  </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

  <div class="partWrap">
        <h2 class="ttpl pdbm">Add Online Promotione</h2>
        <div class="clear5"></div>
		<h5 class="ttpl">Online Promotions</h5>
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
		 <tbody>
		  <tr> 
		   <td id="OnlineP" colspan="12">
            <div class="activediv">
               <table cellpadding="0" cellspacing="0" border="0" width="100%">
		         <tbody>
		          <tr>
                   <td width="20">
                    <p>&nbsp;</p>
                    <p class="upinput">&nbsp;</p>
                    <img src="../Media/Css/images/add-green.png" class="upimg addimg" onclick='AddFormModel("OP")' />
                   </td>
		           <td>
		            <p>&nbsp;</p>
		            <p class="upinput">Rec'd Date</p>
			        <input type="text" class="input70" value="01 Mar 2011">
		           </td>
		           <td>
		            <p>&nbsp;</p>
		            <p class="upinput">Price Code</p>
			        <select class="select80"><option>GPOMIF</option></select>
		           </td>
		           <td>
		            <p>&nbsp;</p>
			        <p class="upinput">Online Package</p>
			        <span>A. Near Harbour Ktchen</span>
		           </td>
		            <td>
		            <p>&nbsp;</p>
			        <p class="upinput">Qty</p>
			        <select class="sl1"><option>9</option></select>
		           </td> 
		           <td>
		            <p>&nbsp;</p>
			        <p class="upinput">Unit</p>
			        <select class="select50"><option></option></select>
		           </td>  
		           <td>
		            <p>&nbsp;</p>
			        <p class="upinput">Unit Cost</p>
			        <span>HKD 400.00</span>
		           </td>
		           <td>
		            <p>&nbsp;</p>
			        <p class="upinput">Sub-Total</p>
			        <span>HKD 1,200.00</span>
		           </td>
		           <td>
			        <p class="mdd-s">Surcharge</p>
			        <table cellspacing="0" cellpadding="0" border="0" class="all-pr-table">
                    <tr>
                      <td>
                       <p class="upinput">Currency</p>
                       <select class="sl2"><option>HKD</option></select>
                      </td>
                      <td>
                       <p class="upinput">$</p>
                       <input type="text" class="input20"">
                      </td>
                      <td>
                       <p class="upinput">%</p>
                       <input type="text" class="input20"">
                      </td>
                    </tr>
                  </table>
		           </td>
		           <td>
			        <p class="mdd-d">Discount</p>
			        <table cellspacing="0" cellpadding="0" border="0" class="all-pr-table">
                    <tr>
                      <td>
                       <p class="upinput">Currency</p>
                       <select class="sl2"><option>HKD</option></select>
                      </td>
                      <td>
                       <p class="upinput">$</p>
                       <input type="text" class="input20"">
                      </td>
                      <td>
                       <p class="upinput">%</p>
                       <input type="text" class="input20"">
                      </td>
                    </tr>
                  </table>
		           </td>
		           <td>
		            <p>&nbsp;</p>
			        <p class="upinput">Sub Total</p>
			        <span>HKD 1,200.00</span>
		           </td>
                  </tr>
		         </tbody>
		       </table>
            </div>
           </td>
          </tr>
          <tr>
             <td width="20">&nbsp;</td>
		     <td colspan="10">
		     <p class="upinput">&nbsp;</p>
		     <textarea class="textarea800">Remark</textarea>
		     </td>
		  </tr>
         </tbody>
        </table>
		  

    <div class="clear20"></div>

    <table width="200" border="0" cellpadding="0" cellspacing="0">
		<tr>
        <td width="20">&nbsp;</td>
		<td>
		<ul class="uibtn">
		<li><a>Save</a></li>
		</ul>	 
		</td>
		<td>
		<ul class="uibtn">
		<li><a>Cancel</a></li>
		</ul>	
		</td>
		</tr>
	</table>

  </div>
</asp:Content>
